package thinking.函数高级

object 视图界定 {
  def main(args: Array[String]): Unit = {

    val value = new CompareComm(1, 11)
    println(value.greater)
  }


}

class CompareComm[T <% Comparable[T]](obj1: T, obj2: T) {
  def greater = if (obj1.compareTo(obj2) > 0) obj1 else obj2
}
